package day06.homework.demo2;

import util.DateUtil;

import java.util.Date;

public class TestEmp {
    public static void main(String[] args) {
        Emp[] emps = new Emp[4];

        Emp salaried = new SalariedEmployee("admin", DateUtil.createDate(2021,1,11),2500.0d);

        Emp hoursEmp = new HourlyEmployee("tom",new Date(),170,10);

        Emp sales = new SalesEmployee("jack",new Date(),10000.0d,0.1);

        Emp salesBase = new BasedPlusSalesEmployee("jack",new Date(),10000.0d,0.1,2500.0d);

        emps[0] = salaried;
        emps[1] = hoursEmp;
        emps[2] = sales;
        emps[3] = salesBase;

        System.out.println(salaried.getSalary(1));

        System.out.println(hoursEmp.getSalary(1));

        System.out.println(sales.getSalary(1));

        System.out.println(salesBase.getSalary(1));

        for (Emp emp : emps){
            System.out.println(emp.getSalary(1));
        }
    }
}
